package servlet;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

//		try {
//			InitialContext ctx = new InitialContext();
//			HelloRemote hello=(HelloRemote)ctx.lookup("Hello/remote");
//			System.out.println(hello.say("ף��Ρ"));
//		} catch (NamingException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//	String requestResource = "/sadfsadf/";
//	String projectName;
//	int firstplace,lastplace;
//	firstplace=requestResource.indexOf("/");
//	lastplace=requestResource.lastIndexOf("/");
//	if(firstplace==lastplace){
//		projectName="";
//	}
//	else{
//		projectName=requestResource.substring(firstplace+1, lastplace);
//	}
		
		ByteArrayOutputStream a = new ByteArrayOutputStream();
		
//		PrintWriter out1 = new PrintWriter(a);
//		out1.print("0123456789");
//		out1.close();
//		System.out.println(a.size());
//		System.out.println(a.toString());
//		ByteArrayInputStream dd = new ByteArrayInputStream(a.toByteArray());
//		System.out.println(getGMT(new Date()));
		String as = "/asdasdasdas.jsp";
		System.out.println(as.indexOf("/", 1));
	}
	public static String getGMT(Date dateCST) {
		   DateFormat df = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.ENGLISH);
		   df.setTimeZone(TimeZone.getTimeZone("GMT")); // modify Time Zone.
		   return(df.format(dateCST));
		}

}
